
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
	<meta charset="UTF-8">
	<title>添加商品</title>
	<script th:src="@{/layui/layui.js}" type="text/javascript"></script>
	<link th:href="@{/layui/css/layui.css}" rel="stylesheet" />
	<script th:src="@{/js/selectM.js}" type="text/javascript"></script>
	<script th:src="@{/js/selectN.js}" type="text/javascript"></script>
	<link rel="stylesheet" th:href="@{/upload/css/publish.css}" media="all">
	<script type="text/javascript" th:src="@{/upload/js/move.js}"></script>
	<script type="text/javascript" th:src="@{/upload/js/publishImg.js}"></script>
	<!---->
	<!--<script type="text/javascript" th:src="@{/js/inputTag.js}"></script>
	<link th:href="@{/css/inputTag.css}" rel="stylesheet" />-->
</head>
<body>

<div class="layui-container" style="margin: 10px 0px;">

	<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
		<legend>物流信息</legend>
	</fieldset>

	<form class="layui-form layui-form-pane">

		<input type="hidden" id="id" name="id" th:value="${os.id}">

		<!--物流模块-->
		<div class="layui-form-item">
			<label class="layui-form-label">收货人</label>
			<div class="layui-input-block">
				<input class="layui-input" th:value="${os.shipName}" name="shipName" autocomplete="off"/>
			</div>
		</div>

		<div class="layui-form-item">
			<label class="layui-form-label">收货电话</label>
			<div class="layui-input-block">
				<input class="layui-input" th:value="${os.mobile}" name="mobile" autocomplete="off"/>
			</div>
		</div>

		<div class="layui-form-item">
			<label class="layui-form-label">物流单号</label>
			<div class="layui-input-block">
				<input class="layui-input" th:value="${os.shipSn}" name="shipSn" autocomplete="off"/>
			</div>
		</div>

		<div class="layui-form-item">
			<label class="layui-form-label">物流公司</label>
			<div readonly class="layui-input-block">
				<input type="radio" name="shipChannel" value="0" title="顺丰快递"  th:checked="${os.shipChannel} eq '0' " />
				<input type="radio" name="shipChannel" value="1" title="其他快递"  th:checked="${os.shipChannel} eq '1' " />
				<input type="radio" name="shipChannel" value="2" title="未发货"  th:checked="${os.shipChannel} eq '2' " />
			</div>
		</div>


		<div class="layui-form-item" style="display: none;">
			<div class="layui-input-block">
				<a class="layui-btn" id="submitBtn" lay-submit="" lay-filter="submitBtn">提交</a>
			</div>
		</div>

	</form>

</div>

<script>


	var $;
	layui.use(['layedit','laydate','table','form','jquery','layer','upload','element','selectN','selectM'],function(){
		$ = layui.jquery;
		var form = layui.form,
				layer = layui.layer,
				laydate = layui.laydate;


		laydate.render({
			elem: '#updateTime' //指定元素
		});

		form.on('submit(submitBtn)',function (data) {
			var formData = data.field;
			console.log(formData);
			$.ajax({
				type:'post',
				url:'/order/oc/update',
				data:formData,
				dataType:'json',
				success:function (result) {
					layer.msg(result.msg);
					if (result.is){
						let index = parent.layer.getFrameIndex(window.name);
						parent.layer.close(index);  //编辑成功后关闭父页面窗口
						parent.layui.table.reload('orderTable');//根据表格id刷新父页面表格
					}
				}
			})
		})

	});

	function btnSubmit(){
		$('#submitBtn').click();
	}




</script>

</body>
</html>

